<template>
  <div>
    <custom-form
      :columns="columns"
      :rules="rules"
      v-bind="$attrs"
      v-on="listeners"
    >

    </custom-form>
  </div>

</template>

<script>
import customFromMixin from '@/utils/mixin/custom-form'

export default {
  name: 'AddForm',
  mixins: [customFromMixin],
  data() {
    return {
      rules: {},
      // 列配置
      columns: [
        { name: '姓名', field: 'real_name', opts: { required: true, maxlength: 50 } },

        // {
        //   name: '房型',
        //   field: 'room_type.name',
        //   opts: { control: 'roomType', name: 'name', required: true },
        //   type: 'select_table'
        // },
        // { name: '姓名', field: 'nickname', opts: { required: true, maxlength: 50 } },
        {
          name: '性别',
          field: 'sex',
          opts: { required: true, maxlength: 50 },
          type: 'radio',
          label: true
          // list: { 1: '男', 2: '女' },
          // value: 1
        },
        { name: '出生年月日', field: 'birthday', type: 'date', opts: { required: true } },
        {
          name: '状态',
          field: 'alone',
          opts: { required: true, maxlength: 50 },
          type: 'radio',
          label: true,
          // list: { 1: '男', 2: '女' },
          value: 1
        },
        { name: '手机', field: 'tel', opts: { required: true, maxlength: 11 } },
        { name: '身份证', field: 'id_card', opts: { required: true, maxlength: 20 } },
        { name: '公司', field: 'word_unit', opts: { required: true, maxlength: 50 } },
        // { name: '房间朝向', field: 'direction', opts: { maxlength: 50 } },
        { name: '人脸', field: 'avatar', type: 'upload_image' },
        // { name: '日期', field: 'start_time', type: 'date' },
        // { name: '租户', field: 'user.nickname', opts: { control: 'user', label: 'nickname' }, type: 'select_table' },
        // { name: '状态', field: 'status', label: true, type: 'radio', opts: { required: true } },
        { name: '备注', field: 'mark', type: 'textarea', opts: { maxlength: 120 } }

      ]
    }
  },
  watch: {},
  methods: {
    // onSubmit(...detail) {
    //   console.log('获取成功', detail)
    // }
  }
}
</script>

<style scoped>

</style>
